<!-- inc:frame.top -->

<!-- if($sysAct == "cate") -->
<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=form&act=list">留言管理</a> &raquo; 表单管理</p><!-- inc:position.fr --></div>

<div class="page_pad">
  <div class="content_add"><button class="gbutton gbutton_dblue gbutton_add" type="button" onclick="qgurl('{:$mainlink}?file=form&act=cateview')">添加表单</button></div>
  
  <div class="content_box">
    <div class="content_bor">
      <table class="qg_notice">
        <tr>
          <td>每个表单都包含：姓名(username)、邮箱(email)、电话(tel)、留言内容(content)，四个基本字段，无需手动添加</td>
        </tr>
      </table>
      <table class="ltable">
        <tr class="first">
          <td width="100">表单ID</td>
          <td width="180">表单标示</td>
          <td width="80">字段数量</td>
          <td align="left"><span style="padding-left:80px;">表单名称</span></td>
          <td width="330">操作</td>
        </tr>
        <!-- $formlist AS $key=>$value -->
        <tr>
          <td>{:$value[id]}</td>
          <td>{:$value[sign]}</td>
          <td>{:$value[field_num]}</td>
          <td align="left"><span style="padding-left:80px;">{:$value[form_name]}</span></td>
          <td><button class="gbutton" type="button" onclick="qgurl('{:$mainlink}?file=form&act=cateview&id={:$value[id]}')">编辑</button> &nbsp; <button class="gbutton" type="button" onclick="qgurl('{:$mainlink}?file=form&act=fieldlist&formid={:$value[id]}')">字段管理</button> &nbsp; <button class="gbutton" type="button" onclick="to_delete({:$value[id]})">删除</button></td>
        </tr>
        <!-- end -->
      </table>
    </div>
  </div><!--content_box-->
</div><!--page_pad-->

<script>
function to_delete(id)
{
	url = "{:$mainlink}?file=form&act=catedelete&id="+id;
	tip_confirm("确认删除该信息吗？特别说明，删除后无法恢复！",url);
}
</script>

<!-- elseif($sysAct == "cateview") -->
<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=form&act=list">留言管理</a> &raquo; <a href="{:$mainlink}?file=form&act=cate">表单管理</a> &raquo; 添加表单</p><!-- inc:position.fr --></div>

<div class="page_pad">
  <form method="post" action="{:$mainlink}?file=form&act=cateviewok" onsubmit="return add_msg(this);">
  <input type="hidden" name="id" id="id" value="{:$id}" />
  <div class="content_box">
    <div class="content_bor">
      <table class="ctable">
        <tr>
          <td class="left">表单标示：<span style="color:red;">*</span></td>
          <td class="right"><input class="ginput" type="text" name="sign" id="sign" value="{:$rs[sign]}" /></td>
        </tr>
        <tr>
          <td class="left">表单名称：<span style="color:red;">*</span></td>
          <td class="right"><input class="ginput" type="text" name="form_name" id="form_name" value="{:$rs[form_name]}" /></td>
        </tr>
      </table>
    </div>
  </div><!--content_box-->
  
  <div class="gbutton_div"><button type="submit" class="gbutton gbutton_dblue gbutton_add creat_button"><!-- if($id) -->保存<!-- else -->添加<!-- end --></button> &nbsp; <button type="button" class="gbutton gbutton_add" onclick="qgurl('{:$mainlink}?file=form&act=cate')">返回</button> &nbsp; <span class="show_step" style="color:red;"><img src="images/loading.gif" style="visibility:hidden;" /></span></div>
  </form>
</div><!--page_pad-->

<script>
function add_msg(o)
{
	if(!o.sign.value)
	{
		tip_msg("表单标示不允许为空");
		return false;
	}
	if(!o.form_name.value)
	{
		tip_msg("表单名称不允许为空");
		return false;
	}
	$(".show_step").html("<img src='images/loading.gif' border='0' align='absmiddle'> 正在保存数据，如果网页没有动静请刷新...");
	$(".creat_button").attr("disabled","disabled");
}
</script>

<!-- elseif($sysAct == "fieldlist") -->
<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=form&act=list">留言管理</a> &raquo; <a href="{:$mainlink}?file=form&act=cate">表单管理</a> &raquo; 字段管理</p><!-- inc:position.fr --></div>

<div class="page_pad">
  <div class="content_add"><button class="gbutton gbutton_dblue gbutton_add" type="button" onclick="qgurl('{:$mainlink}?file=form&act=fieldview&formid={:$formid}')">添加字段</button> <button class="gbutton gbutton_dblue gbutton_add" type="button" onclick="qgurl('{:$mainlink}?file=form&act=fieldorder&formid={:$formid}')">字段排序</button> <button class="gbutton gbutton_add" type="button" onclick="qgurl('{:$mainlink}?file=form&act=cate')">返回</button></div>
  
  <div class="content_box">
    <div class="content_bor">
      <table class="ltable">
        <tr class="first">
          <td width="100">状态</td>
          <td width="160">字段标示</td>
          <td width="240">字段名称</td>
          <td align="left">前台html代码（单个）</td>
          <td width="220">操作</td>
        </tr>
        <!-- $fieldlist AS $key=>$value -->
        <tr>
          <td><!-- if($value[ifcheck]==1) -->已审核<!-- else --><span class="color_red">未审核</span><!-- end --></td>
          <td>{:$value[sign]}</td>
          <td>{:$value[field_name]}</td>
          <td align="left">&lt;input type=&quot;text&quot; name=&quot;{:$value[sign]}&quot; /&gt;</td>
          <td><button class="gbutton" type="button" onclick="qgurl('{:$mainlink}?file=form&act=fieldview&formid={:$formid}&id={:$value[id]}')">编辑</button> &nbsp; <button class="gbutton" type="button" onclick="to_delete({:$value[id]})">删除</button></td>
        </tr>
        <!-- end -->
      </table>
      <!-- if($fieldlist) -->
      <div class="codedemo">
        <div class="h1">前台表单字段表调用代码</div>
        <div class="h2">
          <p>&lt;!-- run:$formlist = QGMOD_FORMLIST(&quot;<span class="color_red">{:$rs[sign]}</span>&quot;) --&gt;</p>
          <p>&lt;!-- $formlist AS $key=&gt;$value --&gt;</p>
          <p>&lt;p&gt;{run:echo "{:"}$value[field_name]}：&lt;input type=&quot;text&quot; name=&quot;{run:echo "{:"}$value[sign]}&quot; value=&quot;&quot; /&gt;&lt;/p&gt;</p>
          <p>&lt;!-- end --&gt;</p>
          <p>&lt;!-- run:unset($formlist) --&gt;</p>
        </div>
        <div class="h3">注意：1.<span class="color_red">{:$rs[sign]}</span>为表单标示；2.具体前端样式根据需求自行修改。</div>
      </div><!--codedemo-->
      <!-- end -->
    </div>
  </div><!--content_box-->
</div><!--page_pad-->

<script>
function to_delete(id)
{
	url = "{:$mainlink}?file=form&act=fielddelete&formid={:$formid}&id="+id;
	tip_confirm("确认删除该字段吗？特别说明，删除后无法恢复！",url);
}
</script>

<!-- elseif($sysAct == "fieldview") -->
<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=form&act=list">留言管理</a> &raquo; <a href="{:$mainlink}?file=form&act=cate">表单管理</a> &raquo; <a href="{:$mainlink}?file=form&act=fieldlist&formid={:$formid}">字段管理</a> &raquo; <!-- if($id) -->编辑字段<!-- else -->添加字段<!-- end --></p><!-- inc:position.fr --></div>

<div class="page_pad">
  <form method="post" action="{:$mainlink}?file=form&act=fieldviewok&formid={:$formid}" onsubmit="return add_msg(this);">
  <input type="hidden" name="id" id="id" value="{:$id}" />
  <div class="content_box">
    <div class="content_bor">
      <table class="ctable">
        <tr>
          <td class="left">审核：</td>
          <td class="right">
            <input type="radio" name="ifcheck" value="0"{if(!$rs[ifcheck])} checked{end}>
			<span>未审核</span>
            &nbsp;
			<input type="radio" name="ifcheck" value="1"{if($rs[ifcheck])} checked{end}>
			<span>已审核</span>
          </td>
        </tr>
        <tr>
          <td class="left">字段标示：<span style="color:red;">*</span></td>
          <td class="right">
            <input class="ginput" type="text" name="sign" id="sign" value="{:$rs[sign]}" placeholder="例：fax" />
            &nbsp;
            <span>[只能由英文字母、数字和下划线组成，并且仅能字母开头，不以下划线结尾]</span>
          </td>
        </tr>
        <!--if($system[jianti] == on) -->
        <tr>
          <td class="left">简体字段名称：<span style="color:red;">*</span></td>
          <td class="right"><input class="ginput" type="text" name="field_name" id="field_name" value="{:$rs[field_name]}" placeholder="例：传真" /></td>
        </tr>
        <!-- end -->
        <!--if($system[fanti] == on) -->
        <tr>
          <td class="left">繁体字段名称：<span style="color:red;">*</span></td>
          <td class="right"><input class="ginput" type="text" name="field_name_ft" id="field_name_ft" value="{:$rs[field_name_ft]}" /></td>
        </tr>
        <!-- end -->
        <!--if($system[english] == on) -->
        <tr>
          <td class="left">英文字段名称：<span style="color:red;">*</span></td>
          <td class="right"><input class="ginput" type="text" name="field_name_en" id="field_name_en" value="{:$rs[field_name_en]}" /></td>
        </tr>
        <!-- end -->
      </table>
    </div>
  </div><!--content_box-->
  
  <div class="gbutton_div"><button type="submit" class="gbutton gbutton_dblue gbutton_add creat_button">保存</button> &nbsp; <button type="button" class="gbutton gbutton_add" onclick="qgurl('{:$mainlink}?file=form&act=fieldlist&formid={:$formid}')">返回</button> &nbsp; <span class="show_step" style="color:red;"><img src="images/loading.gif" style="visibility:hidden;" /></span></div>
  </form>
</div><!--page_pad-->

<script>
function add_msg(o)
{
	if(!o.sign.value)
	{
		tip_msg('字段标示不允许为空');
		return false;
	}
	<!--if($system[jianti] == on) -->
	if(!o.field_name.value)
	{
		tip_msg('字段名称不允许为空');
		return false;
	}
	<!-- end -->
    <!--if($system[fanti] == on) -->
	if(!o.field_name_ft.value)
	{
		tip_msg('字段标示不允许为空');
		return false;
	}
	<!-- end -->
	<!--if($system[english] == on) -->
	if(!o.field_name_en.value)
	{
		tip_msg('字段标示不允许为空');
		return false;
	}
	<!-- end -->
	$(".show_step").html("<img src='images/loading.gif' border='0' align='absmiddle'> 正在保存数据，如果网页没有动静请刷新...");
	$(".creat_button").attr("disabled","disabled");
}
</script>

<!-- end -->

<!-- inc:frame.bottom -->